package com.tanhua.server.interceptor;


import com.tanhua.domain.db.User;

public class UserThreadLocal {

    private static final ThreadLocal<User> LOCAL = new ThreadLocal<>();

    private UserThreadLocal() {

    }

    public static void set(User user) {
        LOCAL.set(user);
    }

    public static User get() {
        return LOCAL.get();
    }

    public static Long getUserId() {
        return LOCAL.get().getId();
    }

    public static String getUserMobile() {
        return LOCAL.get().getMobile();
    }
}
